A technique has conventionally been present for an encoding apparatus that encodes a moving image to search for a block similar to a block to be processed in an original image of the moving image. For example, the encoding apparatus acquires an evaluation value that indicates an encoding amount by comparing for each reference block of a reference image, a pixel value of the reference block and a pixel value of a block to be processed; identifies a difference in the spatial position of the reference block whose evaluation value is the most favorable and the block to be processed, as a first candidate motion vector; determines that a motion vector of a block that is adjacent to the block to be processed is a second candidate motion vector; acquires an evaluation value of the second candidate motion vector by comparing the pixel value of the reference block indicated by the second candidate motion vector and the pixel value of the block to be processed; compares the evaluation value of the first candidate motion vector and that of the second candidate motion vector; and selects the motion vector whose evaluation value is favorable.
For example, according to a related technique, an approximate high-order curved surface is produced using, as the evaluation values, a cumulative sum of absolute differences (SAD) value at the minimum position of the cumulative SAD values and plural cumulative SAD values in the vicinity of the minimum position; a local minimal value position of the approximate high-order curved surface is detected; and a motion vector at decimal-fraction precision is detected. According to another technique, in a case where it is determined whether the block to be processed is in a skip mode or a special direct mode, when no motion vector of the adjacent block can be acquired, the mode determination is pseudo executed using a motion vector of another block in the vicinity of the block to be processed (see, e.g., Japanese Laid-Open Patent Publication Nos. 2007-318578 and 2005-244503).
However, according to the conventional techniques, a process to acquire the evaluation value of the second candidate motion vector is performed and therefore, the process concerning the encoding of the moving image takes a long time. For example, when it is intended to execute in parallel the process of acquiring the evaluation value of the first candidate motion vector and that of the second candidate motion vector, plural circuits to each acquire evaluation values and plural memories to respectively store the pixel values have to be prepared and therefore, the scale of the circuit increases.